<#assign servicePackage = servicePackage!(package + ".service") />
<#assign entityPackage = entityPackage!(package + ".entity") />
<#assign entity = entityName />
<#include "Copyright.ftl"/>
package ${servicePackage};

import com.glanway.gone.service.CrudService;
import ${entityPackage}.${entity};

<#include "ClassComment.ftl" />
public interface ${entity}Service extends CrudService<${entity}, String> {
<#--
    // 一对一级联保存更新好像还没有遇到过

    // 如果当前是 many cascade persist,merge,remove
    // 如果是 one to many
    // relDao.save

    save(entity);
    many = getMany();
    many.setOne(entity);
    save(many);

    many = getMany();
    save(many);
    saveEntityAndMany(entity, many);

    // update
    managed = find(detached.getId());
    if (null == managed) {
        throw
    }
    update(detached);

    // update case one to many
    managedMany = managed.getMany();
    detachedMany = detached.getMany();

    // update cascade many to many
    managedMany = managed.getMany();
    detachedMany = detached.getMany();
    if (managedMany.contains(detachedMany)) {;
        update
    }
    // 新增
    if (!managedMany.contains(detachedMany)) {
        save(detachedMany);
        save(managed, detachedMany);
    }
    if (!detachedMany.contains(managedMany)) {
        remove(managed, detached);
        remove(detached);
    }
    -->
}
